{
  // 传入的为
  const func = (a: string, b: number, c: boolean) => {};

  // 返回值为
  // (a: string) => (b: number) => (c: boolean) => void
}

// prettier-ignore
type CurriedFunc<Params, Return> = Params extends []
  ? () => Return
  : Params extends [infer Arg]
    ? (arg: Arg) => Return
    : Params extends [infer Arg, ...infer Rest]
      ? (arg: Arg) => CurriedFunc<Rest, Return>
      : never;

// prettier-ignore
declare function currying<Func>(fn: Func): 
  Func extends (...args: infer Params) => infer Result 
    ? CurriedFunc<Params, Result> 
    : never;
